package com.dmgis.hndz.common.config;

import java.io.InputStream;
import java.util.Properties;

/**
 * This class is used for 系统配置信息
 *
 * @author dsq
 * @version 1.0, 2018年8月7日 上午9:42:16
 */
public final class DbConfig {
    // Properties
    static {
        Properties prop = new Properties();
        // 通过Object.class获取资源路径 path
        // 不以’/'开头时默认是从此类所在的包下取资源，以’/'开头则是从ClassPath根下获取。其只是通过path构造一个绝对路径，最终还是由ClassLoader获取资源。
        // InputStream in = Object.class.getResourceAsStream("/cas.properties");
        InputStream in = DbConfig.class.getClassLoader().getResourceAsStream("dbconfig.properties");
        try {
            prop.load(in);
            Uri = prop.getProperty("uri");
            User = prop.getProperty("user");
            Pwd = prop.getProperty("pwd");
            PicUrl = prop.getProperty("picUrl");
            MinioEndpoint=prop.getProperty("minioEndpoint");
            MinioAccessKey=prop.getProperty("minioAccessKey");
            MinioSecretKey=prop.getProperty("minioSecretKey");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static String Uri;

    public static String User;

    public static String Pwd;

    public static String PicUrl;

    public static String MinioEndpoint;
    public static String MinioAccessKey;
    public static String MinioSecretKey;

}
